package cn.edu.zknu.mita.service.impl;

import cn.edu.zknu.mita.model.User;
import cn.edu.zknu.mita.mapper.UserMapper;
import cn.edu.zknu.mita.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

/**
 * Created by iwlnner on 2020/3/20.
 */
@Service
public class UserService implements IUserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public User checkLogin(String username, String password) {
        String MD5Password = DigestUtils.md5DigestAsHex((password + username).getBytes());
        return userMapper.checkLogin(username,MD5Password);
    }

}
